﻿using System;
using System.Collections.Generic;

[Serializable]
public abstract class BattleLevelTriggerEntity 
{
//	[NonSerialized]
//	public const string TimeTrigger = "TimeTrigger";
//	[NonSerialized]
//	public const string ActionTrigger = "ActionTrigger";

	public float Time { get; protected set; } = 0;
	public LevelTriggerType TriggerType { get; protected set; } = LevelTriggerType.None;
	public LevelActionType ActionType { get; protected set; } = LevelActionType.None;
	public TriggerStatus Status { get; set; } = TriggerStatus.None;


	public bool IsListening => this.Status == TriggerStatus.Listening;
	//用于触发效果的集合
	//public List<string> LstActions { get; protected set; }
	

	public BattleLevelTriggerEntity(float time, LevelTriggerType triggerType, LevelActionType actionType)
	{
		Time = time;
		TriggerType = triggerType;
		ActionType = actionType;
		Status = TriggerStatus.None;
		//IsListening = false;
	}

	abstract public void EffectAction(BattleLogic logic);
} 



public enum LevelTriggerType 
{
	None,
	TimeTrigger,
	ActionTrigger,
}

//TODO GamePlay Time Trigger For Action Invok
[Serializable]
public enum LevelActionType
{
	None = 0,			//Default Type 
	StartAction = 1,	//游戏开启时触发
	EndAction = 2,		//游戏结束时触发
	PlayingAction = 3,	//游戏进程中触发
	PlayerAction = 4,	//角色状态触发

}

public enum TriggerStatus
{
	None = 0,		//Defalut
	Listening = 1,	//正在监听
	Execute = 2,	//正在执行
	Ended = 3,		//结束关闭状态
}